Computer graphic images are often drawn on a raster-scan display and use a two dimensional array of pixels. These pixels are used to sample and render a geometric mathematical model, which represents a virtual world created by a computer graphics modeler. This quantization process often creates problems or anomalies in displaying the primitives or polygons that are processed. One problem is that visual artifacts are produced because the viewer's ability to resolve the image often exceeds the resolution of the display. For example, the image may be displayed at 1024×1280 pixels, which is a much lower resolution than the maximum resolution that the human eye is able to resolve.
The resulting visual problems are called aliasing, which includes undesirable results such as jagged edges, staircasing, flickering, scintillation and other problems. These aliasing effects are especially noticeable when a primitive object or polygon has a straight line or edge that does not align with the horizontal or vertical arrangement of the pixels. As can be imagined, objects in computer graphic images are not always aligned horizontally or vertically with the pixels. Techniques that reduce or eliminate these undesirable effects are referred to as antialiasing.
Of course, image quality is a somewhat subjective property that is heavily judged by the amount of detail in the scene, the presence or lack of artifacts, and similar factors. This is evidenced in the mainstream PC graphics card market by the ever-increasing drive to higher resolutions, more polygons, more lighting effects, and texture maps for increased detail. Off-the-shelf systems are also moving toward MIP-mapped texture and full-screen antialiasing to reduce image artifacts.
One method for reducing aliasing is called supersampling. This approach takes more than one sample for each pixel and combines the samples together to create the final pixel. Each sample or subpixel typically includes a color-value (or grey-scale value) and a Z-value. The depth value or Z-value represents the relative depth of a sample in the scene and it is used to perform hidden surface removal.
Antialiasing is generally implemented with sampling or subpixel buffers that include 2, 4, 8, 16 or more samples per pixel in the pixel resolution image. Each pixel has a corresponding number of samples, such as 16 samples for each pixel. These sampling buffers have often been implemented with dynamic random access memory (DRAM or SDRAM) or other more expensive types of high speed RAM.
Expensive ways of improving edge quality include simply taking more samples per pixel, or implementing an analytical pixel coverage algorithm using alpha. More samples per pixel require more hardware for equivalent performance as compared to a system with fewer samples per pixel. In addition, analytical pixel coverage requires depth sorting for primitives and does not handle interpenetration of primitives. Alpha based methods (i.e., edge antialiasing) are also generally considered incompatible with multi-sample, Z-buffered techniques or full-screen antialiasing.
One variation of the supersampling technique enables additional samples to be taken only for pixels that are intersected by edges. This technique can increase the image quality, however, the number and location of samples calculated are variable and may vary from frame to frame. The determination of the number and location of samples must be done as the pixels are rendered. Essentially, this increases the amount of hardware storage area, but not as dramatically as a system that uses a fixed number of samples.
Another tool that is used to overcome aliasing is performing filtering. For example, post filtering is the filtering of an image after point sampling when it is stored in the frame buffer. Filtering averages pixels together and reduces image contrast that can create aliasing. The most basic form of filtering is applying a flat top filter, one pixel in size, to the samples in each pixel. Higher quality antialiasing can be achieved using a filter kernel of greater than one pixel in size over the entire image. For example, a type of filtering known as “quincunx” has been used in Nvidia graphics chips. The quincunx method uses post filtering on a two sample per pixel sampling pattern. Specifically, 5 samples are filtered to get the value of each displayed pixel and 3 of the samples are derived from adjoining pixels.
Filter kernels approximating the sinc function (the ideal low pass filter), such as a 2×2 Gaussian filter have resulted in better edge quality. These larger post-filters result in the smoothing of edges and reduced artifacts. A side effect of a larger post filter is that some detail is lost across the whole image. This trade-off in loss of detail when using a fixed filter across the image has generally been tolerated because it helps reduce the aliasing.
Current filtering methods apply a filter with a fixed size and weighting uniformly across an entire graphic image. For example, a fixed filter can be applied as a post-filter or a texture filter. This results in a uniform reduction of artifacts such as stair-stepping, scintillation, and popping. However, it also results in a uniform reduction in detail and clarity in the image. This type of fixed filter is well known to those skilled in the art and straightforward to ensure that the filter meets the Erdahl criterion for energy contribution from each of the samples or pixels.
The Erdahl equal-energy criterion requires that each sample must make the same overall energy contribution to the picture no matter which filter kernel is applied to a given region. In other words, no picture information should be lost or discarded in filtering. For example, suppose that four samples are taken for a given pixel area, S1, S2, S3 and S4. If the filter uses only these 4 samples to calculate the pixel color and applies a weight of 3/6 to S2 and ⅙ to S1, S3, and S4, then there is information lost from S1, S3, and S4 relative to S2. The negative consequences of not obeying the Erdahl criterion are usually observed in objects in motion relative to the screen. FIG. 1 shows a circular object in relationship to a sample grid in which the samples are weighted in violation of the Erdahl criterion. The samples with the dark outline are weighted by 3/6 and the others are weighted ⅙. In this location, the object covers 11 samples with a total weight of1*( 3/6)+10*(⅙)=2⅙
FIG. 2 shows the same circular object which has moved to a slightly different location. It also covers 11 samples, but the sample weighting produces a total weight of3*( 3/6)+8*(⅙)=2⅚
Thus, the total weight of the object is not the same in the two locations because of the unbalanced weighting. The visual result is that the object would appear to “twinkle” as it moves across the screen.
If the weighting of each of the 4 samples were the same (¼) then the total weight in either the position of FIG. 1 or the position of FIG. 2 would be11*(¼)=2¾.